package com.hqkj.haoqiao.front.stage.controller;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.hqkj.haoqiao.front.stage.biz.CountryBiz;
import com.hqkj.haoqiao.front.stage.biz.HotHotelsBiz;
import com.hqkj.haoqiao.front.stage.biz.HotelsBiz;
import com.hqkj.haoqiao.model.Country;
import com.hqkj.haoqiao.model.HotHotel;

@Controller
@RequestMapping("/hotel")
public class HotelsController {
	@Resource
	private HotelsBiz hotelsbiz ;
	@Resource
	private HotHotelsBiz hothotelsbiz;
	@Resource
	private CountryBiz countrybiz; 
	
	@RequestMapping("/hotelinfo")
	public void hotelinfo(Map<String, Object> request ,@RequestParam("hotelId") int hotelId){
		
		System.out.println(hotelsbiz.findById(hotelId).getHotelName());
		request.put("hotels", hotelsbiz.findById(hotelId));
	}
	
	@RequestMapping("/list")
	public String list( Map<String, Object> request ){
		List<HotHotel> hotlist = hothotelsbiz.findAll();
		request.put("hotlist", hotlist);
		
		List<Country> conlist = countrybiz.findAll();
		request.put("conlist", conlist);		
		return "/hotel/shouye" ;
	}
	
	
}
